<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>ZDH 数据质量报告首页</title>
    <meta name="keywords" content="ZDH 数据质量报告首页">
    <meta name="description" content="ZDH 数据质量报告首页">

    <link rel="shortcut icon" href="img/favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <link href="css/plugins/datetimepicker/datetimepicker.css" rel="stylesheet">
    <link href="css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <!-- Panel Other -->
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>质量检测报告查询列表</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="buttons.html#">
                        <i class="fa fa-eye"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="javascript:void(0);" onclick="getResourceDesc()">功能说明</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="ibox-content">

                <form role="form" class="form-inline" id="quota_form">

                    <div class="form-group">
                        <div class="input-group" >
                            <input id="job_context" name="job_context" class="form-control" type="text" value="" placeholder="调度任务说明">
                            <span class="add-on"><i class="icon-remove"></i></span>
                            <span class="add-on"><i class="icon-calendar"></i></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="input-group" >
                            <input id="etl_context" name="etl_context" class="form-control" type="text" value="" placeholder="ETL任务说明">
                            <span class="add-on"><i class="icon-remove"></i></span>
                            <span class="add-on"><i class="icon-calendar"></i></span>
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="input-group">
                            <select data-placeholder="状态" class="chosen-select" style="width:110px;" tabindex="2" id="status" name="status">
                                <option value="" hassubinfo="true">空</option>
                                <option value="通过" hassubinfo="true">通过</option>
                                <option value="不通过" hassubinfo="true">不通过</option>
                                <option value="容错率内" hassubinfo="true">容错率内</option>
                            </select>
                        </div>
                        <input id="search" οnsubmit='return false' type="button" class="btn btn-primary form-control" style="margin-bottom:0px" value="查询"/>
                    </div>

                </form>

                <div class="row row-lg">

                    <div class="col-sm-12">
                        <!-- Example Events -->
                        <div class="example-wrap">
                                <div class="btn-group" id="exampleTableEventsToolbar" role="group">
                                    <button id="remove" type="button" class="btn btn-outline btn-default">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                                    </button>
                                </div>
                                <table id="exampleTableEvents" data-height="400" data-mobile-responsive="true">

                                </table>
                            </div>
                        </div>
                        <!-- End Example Events -->
                    </div>
            </div>
            <!--</div>-->
        </div>
        <!-- End Panel Other -->
    </div>


    <script src="js/zdh_common.js"></script>
    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>

    <!-- layer javascript -->
    <script src="js/plugins/layer/layer.min.js"></script>

    <!-- 自定义js -->
    <script src="js/content.js?v=1.0.0"></script>


    <!-- Bootstrap table -->
    <script src="js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <!-- Peity -->
    <script src="js/etl/quality_index.js"></script>

    <script src="js/plugins/chosen/chosen.jquery.js"></script>

<script>
    $(document).ready(function () {
        $('#status').chosen();

        $('#remove').click(function () {

            var rows = $("#exampleTableEvents").bootstrapTable('getSelections');// 获得要删除的数据
            if (rows.length == 0) {// rows 主要是为了判断是否选中，下面的else内容才是主要
                layer.msg("请先选择要删除的记录!");
                return;
            } else {
                var ids = new Array();// 声明一个数组
                $(rows).each(function() {// 通过获得别选中的来进行遍历
                    ids.push(this.id);// cid为获得到的整条数据中的一列
                });
                console.log(ids);
                deleteMs(ids)
            }

        });

        function deleteMs(ids) {
            $.ajax({
                url : server_context+"/quality_delete",
                data : "ids=" + ids,
                type : "post",
                dataType : "json",
                success : function(data) {
                    console.info("success");
                    layer.msg(data.msg);
                    $('#search').click()
                },
                error: function (data) {
                    console.info("error: " + data.responseText);
                }

            });
        }



        $('#search').click(function () {
            $('#exampleTableEvents').bootstrapTable('refresh', {
                url: server_context+"/quality_list?"+$("#quota_form").serialize(),
                contentType: "application/json;charset=utf-8",
                dataType: "json"
            });

        });

        $('#search').click()

    });



</script>

</body>

</html>
